<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/TGB.Master" CodeBehind="FrmFacturaCompra.aspx.vb" Inherits="TGB.FrmFacturaCompra" 
    title="Administracion de Factura Compra" %>

<%@ Register Assembly="BasicFrame.WebControls.BasicDatePicker" Namespace="BasicFrame.WebControls"
    TagPrefix="BDP" %>
<%@ Register Assembly="eWorld.UI" Namespace="eWorld.UI" TagPrefix="ew" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script language="JavaScript" type="text/javascript">
    function popupuno(url)
        {
            var popupuno = window.open(url,"popupuno" ,"Width=700,Height=500,Scrollbars=NO,Resizable=NO,Location=NO,Menubar=NO,Status=NO,Titlebar=NO,Toolbar=NO");
        }
</script>
<script language="JavaScript" type="text/javascript">
    function popup(url)
        {
            var popup = window.open(url,"popup" ,"Width=700,Height=500,Scrollbars=NO,Resizable=NO,Location=NO,Menubar=NO,Status=NO,Titlebar=NO,Toolbar=NO");
        }
</script>
   <div id="DIV1" style="width: 100%; height: 1px; text-align: center; background-color: #ccccff; vertical-align: middle; font-weight: bold;" >
       <asp:LinkButton ID="LinkFacturas" runat="server" Font-Names="Calibri" Font-Size="14px"
           Font-Underline="False" Style="letter-spacing: 3px; text-decoration: underline overline">Listado de Facturas</asp:LinkButton>/<asp:LinkButton ID="LinkNuevo"
               runat="server" Font-Names="Calibri" Font-Size="14px" Font-Underline="False" Style="letter-spacing: 3px;
               text-decoration: underline overline" TabIndex="-1">Nueva Factura</asp:LinkButton>&nbsp;</div><hr /> 
    <div style="width: 100%; height: 280px; text-align: center; background-color: #efefef; vertical-align: middle;" id="DIV2">
        <br />
    <table class="tabla" style="width: 696px; height: 80px; text-align: left;" >
        <tr>
            <td align="right" rowspan="" style="width: 175px; height: 18px;">
                </td>
            <td align="right" rowspan="" style="width: 1342177.27%; height: 18px; color: gainsboro;">
                aaaaaaahhhaa</td>
            <td align="left" colspan="2" rowspan="" style="width: 40px; background-color: #ccccff; height: 18px; position: static;" valign="middle">
                <table style="left: 376px; top: 200px">
                    <tr>
                        <td style="width: 74px; height: 21px">
                            <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="TxtSucursal"
                                ErrorMessage="RangeValidator" MaximumValue="9999" MinimumValue="1" Type="Integer"
                                Width="184px" ValidationGroup="numeracion">Punto de Compra Incorrecto</asp:RangeValidator>
                        </td>
                        <td style="width: 73px; height: 21px">
                        </td>
                        <td style="width: 27px; height: 21px">
                            <asp:Label ID="Label1" runat="server" Text="Fecha" Font-Bold="True" CssClass="campotxt"></asp:Label></td>
                        <td align="left" colspan="2" style="height: 21px">
                            &nbsp;
                            <BDP:BasicDatePicker ID="Calendario" runat="server" DisplayType="LabelAndImage" ReadOnly="True"
                                ShowNoneButton="False" DateFormat="dd-MM-yyyy" Font-Bold="True" Font-Names="Calibri" Font-Size="12px" TitleFormat="ddmmyy" Width="120px">
                            </BDP:BasicDatePicker>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 74px; height: 21px">
                            <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="TxtNumero"
                                Display="Dynamic" ErrorMessage="Numero de Factura Incorrecto" MaximumValue="99999999"
                                MinimumValue="1" Type="Integer" Width="184px" ValidationGroup="numeracion">Numero de Factura Incorrecto</asp:RangeValidator></td>
                        <td style="width: 73px; height: 21px">
                <asp:Label ID="Label2" runat="server" Text="Factura Numero" Font-Bold="True" Width="96px" CssClass="campotxt"></asp:Label></td>
                        <td style="width: 27px; height: 21px">
                <asp:DropDownList ID="CboLetra" runat="server" CssClass="campotxt" Font-Bold="True" TabIndex="1">
                    <asp:ListItem>A</asp:ListItem>
                    <asp:ListItem>B</asp:ListItem>
                    <asp:ListItem>C</asp:ListItem>
                </asp:DropDownList></td>
                        <td style="width: 40px; height: 21px">
                <asp:TextBox ID="TxtSucursal" runat="server" CssClass="campotxt" TabIndex="2" Font-Bold="True" MaxLength="4" Font-Size="10px" Width="37px">0000</asp:TextBox></td>
                            <td style="width: 34px; height: 21px">
                            <asp:TextBox ID="TxtNumero" runat="server" CssClass="campotxt" Font-Bold="True" Font-Size="10px"
                    MaxLength="8" TabIndex="3" Width="64px">00000000</asp:TextBox></td>
                    </tr>
                </table>
                &nbsp;
                &nbsp;&nbsp; &nbsp;
            </td>
            <td align="right" colspan="2" style="width: 64px; height: 18px;" rowspan="">
            </td>
        </tr>
        <tr>
            <td align="right" rowspan="1" style="width: 175px; height: 21px;">
            </td>
            <td align="right" rowspan="1" style="width: 1342177.27%; height: 21px;">
            </td>
            <td align="left" colspan="2" rowspan="1" style="width: 40px; background-color: #ccccff; height: 21px;">
                <table style="width: 736px">
                    <tr>
                        <td style="width: 101px; height: 21px">
                <asp:Label ID="LblProveedor" runat="server" Font-Bold="True" Text="Proveedor" CssClass="campotxt"></asp:Label></td>
                        <td style="height: 21px"><asp:DropDownList ID="CboProveedor" runat="server" CssClass="campotxt" Width="568px" TabIndex="4" AppendDataBoundItems="True" Font-Bold="True" AutoPostBack="True" Font-Size="12px">
                            <asp:ListItem Value="-1">Seleccione un Proveedor</asp:ListItem>
                        </asp:DropDownList></td>
                    </tr>
                </table>
            </td>
            <td align="left" colspan="2" style="width: 64px; height: 21px">
            </td>
        </tr>
        <tr>
            <td align="right" style="width: 175px;">
            </td>
            <td align="right" style="width: 1342177.27%;">
            </td>
            <td align="left" colspan="2" style="width: 40px; background-color: #ccccff;">
                <table style="width: 736px">
                    <tr>
                        <td style="width: 681px; height: 20px">
                <asp:Label ID="Label6" runat="server" Font-Bold="True" Text="Condicion de Compra" Height="8px" Width="120px" CssClass="campotxt"></asp:Label></td>
                        <td style="width: 632px; height: 20px">
                <asp:DropDownList ID="CboCondicion" runat="server" CssClass="campotxt" Width="504px" TabIndex="7" AppendDataBoundItems="True" Font-Bold="True" AutoPostBack="True">
                    <asp:ListItem Value="-1">Seleccione una condicion</asp:ListItem>
                    <asp:ListItem Value="0">Contado</asp:ListItem>
                    <asp:ListItem Value="30">Cuenta Corriente 30</asp:ListItem>
                    <asp:ListItem Value="60">Cuenta Corriente 60</asp:ListItem>
                </asp:DropDownList></td>
                        <td style="width: 948px; height: 20px">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 681px; height: 20px;">
                <asp:Label ID="Label3" runat="server" Text="Observacion" Font-Bold="True" CssClass="campotxt"></asp:Label></td>
                        <td style="width: 632px; height: 20px;">
                <asp:TextBox ID="TxtObservacion" runat="server" CssClass="campotxt" TabIndex="8"
                    TextMode="MultiLine" Width="544px" Height="32px" MaxLength="100" Font-Size="11px"></asp:TextBox></td>
                        <td style="width: 948px; height: 20px">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 681px; height: 20px">
                <asp:Label ID="Label7" runat="server" Font-Bold="True" Text="Cancela Remitos" Width="104px" CssClass="campotxt"></asp:Label></td>
                        <td style="width: 632px; height: 20px">
                            <asp:DropDownList ID="CboRemitos" runat="server" CssClass="campotxt" Width="504px" TabIndex="5" AppendDataBoundItems="True" Font-Bold="True">
                            <asp:ListItem Value="-1">Seleccione un Remito</asp:ListItem>
                        </asp:DropDownList></td>
                        <td style="width: 948px; height: 20px">
                <asp:LinkButton ID="LinkAgregaRemito" runat="server" TabIndex="6" Width="40px" ValidationGroup="numeracion" Font-Size="10px">Agregar Remito</asp:LinkButton></td>
                    </tr>
                </table>
            </td>
            <td align="left" colspan="3" style="width: 69px;">
                </td>
        </tr>
        <tr>
            <td align="right" style="width: 175px; height: 16px">
            </td>
            <td align="right" style="width: 1342177.27%; height: 16px">
                &nbsp;</td>
            <td align="right" colspan="2" style="width: 40px; height: 16px; background-color: #ccccff">
                <table style="width: 752px">
                    <tr>
                        <td colspan="3">
                            <asp:Label ID="Label19" runat="server" Height="24px" Style="font-weight: bold; font-size: 14px;
                                vertical-align: middle; font-family: Calibri; background-color: #ff3333; text-align: center"
                                Text="Items del Remito" Width="744px"></asp:Label></td>
                    </tr>
                    <tr>
                        <td colspan="3" style="height: 158px">
                            <asp:GridView ID="GridRemito" runat="server" AutoGenerateColumns="False" Width="728px" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Horizontal" CellSpacing="1">
                                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                                <Columns>
                                    <asp:TemplateField HeaderText="Concepto">
                                        <ItemTemplate>
                                            <asp:Label ID="LblDescripcion" runat="server" Text='<%# Bind("Descripcion") %>'></asp:Label>
                                            <asp:HiddenField ID="HFRemito" runat="server" Value='<%# Bind("Remito") %>' />
                                            <asp:HiddenField ID="HFCodigo" runat="server" Value='<%# Bind("CodigoConcepto") %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Cantidad">
                                        <ItemTemplate>
                                            <asp:Label ID="LblCantidad" runat="server" Text='<%# Bind("Cantidad") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Precio Unitario">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("PrecioU") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="LblPrecioU" runat="server" Text='<%# Bind("PrecioU") %>'></asp:Label>&nbsp;
                                            <asp:TextBox ID="TxtPrecioU" runat="server" Font-Names="Calibri" Font-Size="11px"
                                                MaxLength="4" Visible="False" Width="80px" ValidationGroup="Calcular">0</asp:TextBox>
                                            <asp:RangeValidator ID="Datoerror" runat="server" ControlToValidate="TxtPrecioU"
                                                Display="Dynamic" ErrorMessage="Dato Erroneo" Font-Names="Calibri" Font-Size="11px"
                                                MaximumValue="9999" MinimumValue="1" Type="Double" ValidationGroup="Calcular"></asp:RangeValidator>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Imputacion">
                                        <ItemTemplate>
                                            <asp:Label ID="lblDescripcionImputacion" runat="server" Text='<%# bind("DescripcionImp") %>'></asp:Label>
                                            <asp:HiddenField ID="HFIDImputacion" runat="server" Value='<%# bind("CodigoImputacion") %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                                        </EditItemTemplate>
                                        <HeaderTemplate>
                                            &nbsp;
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:LinkButton ID="LnkRemover" runat="server" CommandName="Remover" ValidationGroup="Calcular">Remover</asp:LinkButton>
                                            /
                                            <asp:LinkButton ID="LnkCalcular" runat="server" CommandName="Calcular" Visible="False" ValidationGroup="Calcular">Calcular Total</asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <RowStyle HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                                <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" />
                            </asp:GridView>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td style="width: 644px">
                            <asp:Label ID="Label20" runat="server" Font-Bold="True" Text="Total"></asp:Label></td>
                        <td>
                            <asp:TextBox ID="TxtSubtotalR" runat="server" CssClass="campotxt" Font-Size="10px" ReadOnly="True"
                                Width="80px" Font-Bold="True">0,00</asp:TextBox></td>
                    </tr>
                </table>
            </td>
            <td align="left" colspan="3" style="width: 69px; height: 16px">
            </td>
        </tr>
        <tr>
            <td align="right" style="width: 175px; height: 30px">
            </td>
            <td align="right" style="width: 1342177.27%; height: 30px;">
            </td>
            <td align="left" colspan="3" style="background-color: #ccccff; width: 40px;">
                <asp:Label ID="Label4" runat="server" Text="Items de la Factura" Width="744px" style="font-weight: bold; font-size: 14px; vertical-align: middle; font-family: Calibri; background-color: #ff3333; text-align: center" Height="24px"></asp:Label></td>
            <td align="left" style="height: 30px;">
                &nbsp;</td>
        </tr>
        <tr>
            <td align="right" style="width: 175px; height: 24px;">
            </td>
            <td align="right" style="width: 1342177.27%; height: 24px;">
            </td>
            <td align="left" colspan="3" rowspan="1" style="width: 40px; background-color: #ccccff; height: 24px;">
                <table style="width: 736px">
                    <tr>
                        <td style="width: 307px; height: 30px;">
                <asp:DropDownList ID="CboConcepto" runat="server" CssClass="campotxt" Width="384px" TabIndex="9" AppendDataBoundItems="True" Font-Bold="True">
                    <asp:ListItem Value="-1">Seleccione un Concepto</asp:ListItem>
                </asp:DropDownList></td>
                        <td style="width: 87px; height: 30px;">
                            <asp:Label ID="Label8" runat="server" Font-Bold="True" Text="Precio Unitario" CssClass="campotxt" Width="96px"></asp:Label></td>
                        <td style="width: 77px; height: 30px;">
                <asp:TextBox ID="TxtPrecioU" runat="server" CssClass="campotxt" Font-Size="10px" MaxLength="8"
                    TabIndex="10" Width="72px" Font-Bold="True" ValidationGroup="concepto">0,00</asp:TextBox></td>
                        <td style="width: 59px; height: 30px;">
                            <asp:Label ID="Label9" runat="server" Font-Bold="True" Text="Cantidad" CssClass="campotxt"></asp:Label></td>
                        <td style="width: 50px; height: 30px;">
                <asp:TextBox ID="TxtCantidad" runat="server" CssClass="campotxt" TabIndex="11" MaxLength="4" Font-Size="10px" Width="72px" Font-Bold="True" ValidationGroup="concepto"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 307px; height: 14px;">
                        </td>
                        <td colspan="2" style="height: 14px">
                            <asp:RangeValidator ID="RangeValidator3" runat="server" ControlToValidate="TxtPrecioU"
                                Display="Dynamic" ErrorMessage="Precio no valido" MaximumValue="999999,99" MinimumValue="0,01"
                                Type="Double" ValidationGroup="concepto">verifique precio y cantidad</asp:RangeValidator></td>
                        <td colspan="2" style="height: 14px">
                            </td>
                    </tr>
                    <tr>
                        <td colspan="5" style="height: 14px">
                            <asp:GridView ID="GridConcepto" runat="server" AutoGenerateColumns="False" Width="744px" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Horizontal" CellSpacing="1">
                                <Columns>
                                    <asp:TemplateField HeaderText="Concepto">
                                        <ItemTemplate>
                                            <asp:Label ID="LblDescripcion" runat="server" Text='<%# Bind("Descripcion") %>'></asp:Label>
                                            <asp:HiddenField ID="HFCodigo" runat="server" Value='<%# Bind("CodigoConcepto") %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Cantidad">
                                        <ItemTemplate>
                                            <asp:Label ID="LblCantidad" runat="server" Text='<%# Bind("Cantidad") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Precio Unitario">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("PrecioU") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="LblPrecioU" runat="server" Text='<%# Bind("PrecioU") %>'></asp:Label>
                                            <asp:TextBox ID="TxtPrecioU" runat="server" Font-Names="Calibri" Font-Size="12px"
                                                MaxLength="4" Text='<%# Bind("PrecioU") %>' Visible="False"></asp:TextBox>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Imputacion">
                                        <ItemTemplate>
                                            <asp:Label ID="lblDescripcionImputacion" runat="server" Text='<%# bind("DescripcionImp") %>'></asp:Label>
                                            <asp:HiddenField ID="HFIDImputacion" runat="server" Value='<%# bind("CodigoImputacion") %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:LinkButton ID="LnkRemover" runat="server" CommandName="Remover">Remover</asp:LinkButton>
                                        </ItemTemplate>
                                        <HeaderTemplate>
                                            &nbsp;
                                        </HeaderTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                                <RowStyle HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                                <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" />
                            </asp:GridView>
                        </td>
                    </tr>

                </table>
            </td>
            <td align="left" style="height: 24px" valign="top">
                &nbsp;<table>
                    <tr>
                        <td style="height: 26px">
                <asp:LinkButton ID="LinkAgregar" runat="server" TabIndex="12" ValidationGroup="concepto" Font-Size="10px">Agregar Concepto</asp:LinkButton></td>
                        <td style="width: 3px; height: 26px">
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td style="width: 3px">
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td style="width: 3px">
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="right" style="width: 175px; height: 20px">
            </td>
            <td align="right" style="width: 1342177.27%; height: 20px;">
            </td>
            <td align="left" style="width: 134px; height: 20px;">
                &nbsp;</td>
            <td align="right" style="height: 20px; width: 1022px;">
                <asp:Label ID="Label5" runat="server" Font-Bold="True" Text="Total"></asp:Label>&nbsp;</td>
            <td align="right" style="height: 20px; width: 3px;">
                </td>
            <td align="left" style="height: 20px; border-right: olive thin solid; border-top: olive thin solid; border-left: olive thin solid; border-bottom: olive thin solid;">
                <asp:Label ID="LblTotal" runat="server" Font-Bold="True" Text="0,00" Width="48px" Font-Size="10px"></asp:Label></td>
        </tr>
        <tr>
            <td align="right" colspan="1" style="height: 25px; width: 175px;">
            </td>
            <td align="right" colspan="5" style="height: 25px">
                <asp:LinkButton ID="LinkImputaciones" runat="server" TabIndex="11" style="color: black">Cargar Imputaciones</asp:LinkButton>
                /
                &nbsp;<asp:LinkButton ID="LinkGuardar" runat="server" TabIndex="11" style="color: black">Guardar</asp:LinkButton> /<asp:LinkButton ID="LinkCancelar" runat="server" TabIndex="13" style="color: black">Cancelar</asp:LinkButton>
            
            </td>
        </tr>
        <tr>
            <td align="left" colspan="1" style="height: 22px; width: 175px;">
            </td>
            <td align="left" colspan="5" style="height: 22px">
        <asp:Label ID="LblError" runat="server" Width="760px" Font-Bold="True" Font-Names="Calibri" Font-Overline="False" Font-Size="13px" Font-Strikeout="False" Font-Underline="False" ForeColor="Red" CssClass="LabelError"></asp:Label>
                </td>
        </tr>
        <tr>
            <td align="left" colspan="1" style="width: 175px; height: 22px">
            </td>
            <td align="left" colspan="5" style="height: 22px">
            </td>
        </tr>
        <tr>
            <td align="left" colspan="1" style="width: 175px; height: 22px">
            </td>
            <td align="left" colspan="5" style="height: 22px">
                &nbsp;&nbsp;
                <table style="width: 440px">
                    <tr>
                        <td style="width: 3px; height: 14px">
                <asp:HiddenField ID="HFProveedor" runat="server" />
                        </td>
                        <td style="width: 4px; height: 14px">
                <asp:HiddenField ID="HFFactura" runat="server" />
                        </td>
                        <td style="width: 3px; height: 14px">
                <asp:HiddenField ID="HfCuenta" runat="server" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        
    </table>
        &nbsp;&nbsp;
                 <asp:Button ID="BtnRefrescar" runat="server" BackColor="Transparent" BorderColor="Transparent" BorderStyle="None" ForeColor="Transparent" Height="0px" Width="0px" />
        &nbsp;
            <br />
        </div>
    <hr style="height: 8px" />
</asp:Content>
